﻿// JSON C# Class Generator
// http://at-my-window.blogspot.com/?page=json-class-generator

using System;
using Newtonsoft.Json.Linq;
using JsonCSharpClassGenerator;

namespace BuscoPre.Repository.MLA.JsonTypes
{

    public class Filter
    {

        private JObject __jobject;
        public Filter(JObject obj)
        {
            this.__jobject = obj;
        }

        public string Id
        {
            get
            {
                return JsonClassHelper.ReadString(JsonClassHelper.GetJToken<JValue>(__jobject, "id"));
            }
        }

        public string Name
        {
            get
            {
                return JsonClassHelper.ReadString(JsonClassHelper.GetJToken<JValue>(__jobject, "name"));
            }
        }

        public string Type
        {
            get
            {
                return JsonClassHelper.ReadString(JsonClassHelper.GetJToken<JValue>(__jobject, "type"));
            }
        }

        [System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)]
        private Value[] _values;
        public Value[] Values
        {
            get
            {
                if(_values == null)
                    _values = (Value[])JsonClassHelper.ReadArray<Value>(JsonClassHelper.GetJToken<JArray>(__jobject, "values"), JsonClassHelper.ReadStronglyTypedObject<Value>, typeof(Value[]));
                return _values;
            }
        }

    }
}
